package beans;


import javax.faces.event.ActionEvent;

import oracle.adf.share.logging.ADFLogger;
import oracle.adf.view.rich.component.rich.RichPopup;

import oracle.binding.OperationBinding;

import utils.ADFUtils;


public class AddFishBean {

    private RichPopup addPopup;
    private static ADFLogger LOG = ADFLogger.createADFLogger("AddFishBean");

    public AddFishBean() {
        super();
    }


    public void setAddPopup(RichPopup addPopup) {
        this.addPopup = addPopup;
    }

    public RichPopup getAddPopup() {
        return addPopup;
    }

    public void addNewFish(ActionEvent actionEvent) {

        OperationBinding createFish = ADFUtils.findOperation("createFishDataWithOccurr");
        createFish.execute();

        addPopup.show(new RichPopup.PopupHints());
    }

    public void removeCurrentFishAndOccurence(ActionEvent actionEvent) {
        OperationBinding deleteOccurrence = ADFUtils.findOperation("DeleteOccurrence");
        deleteOccurrence.execute();

        OperationBinding deleteFish = ADFUtils.findOperation("DeleteFish");
        deleteFish.execute();
    }
}
